
import requests

r= requests.get('https://www.baidu.com')
print(r.encoding)
print(r.content)
print(r.text)

r.encoding='utf-8'
print(2,r.text)
print(3,r.headers)
print(4,r.raw)
print(5,r.json)
print(6,r.url)
print(7,r.status_code)
print(8,r.reason)
print(9,r.raise_for_status())




r=  requests.post("http://httpbin.org/post",data = "{'abc':123}")
print(r.text)
print(r.text)



data = {
    'name': 'tom',
    'age': 20
}


r = requests.get('http://httpbin.org/get', params=data)
print(9,r.text)